import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "HOME",
    component: () => import(/* webpackChunkName: "home" */ "@/views/Home.vue"),
    meta: {
      title: "首页",
    },
  },
  {
    path: "/search",
    name: "SEARCH",
    component: () =>
      import(/* webpackChunkName: "search" */ "@/views/Search.vue"),
    meta: {
      title: "发现",
    },
  },
  {
    path: "/searchhistory",
    name: "SEARCHHISTORY",
    component: () =>
      import(
        /* webpackChunkName: "searchHistory" */ "@/views/SearchHistory.vue"
      ),
    meta: {
      title: "搜索历史",
    },
  },
  {
    path: "/s/:key",
    name: "SEARCHRESULT",
    component: () =>
      import(/* webpackChunkName: "searchResult" */ "@/views/SearchResult.vue"),
    meta: {
      title: "搜索结果",
    },
  },
  {
    path: "/message",
    name: "MESSAGE",
    component: () =>
      import(/* webpackChunkName: "message" */ "@/views/Message.vue"),
    meta: {
      title: "消息",
    },
  },
  {
    path: "/my",
    name: "MY",
    component: () => import(/* webpackChunkName: "my" */ "@/views/My.vue"),
    meta: {
      title: "我的",
    },
  },
  {
    path: "/user/:usid",
    name: "USER",
    component: () => import(/* webpackChunkName: "my" */ "@/views/User.vue"),
    meta: {
      title: "用户",
    },
  },
  {
    path: "/edituser/:usid",
    name: "EDITUSERINFO",
    component: () =>
      import(/* webpackChunkName: "editUserInfo" */ "@/views/EditUserInfo.vue"),
    meta: {
      title: "编辑主页",
    },
  },
  {
    path: "/editheader/:usid",
    name: "EDITHEADER",
    component: () =>
      import(/* webpackChunkName: "editHeader" */ "@/views/EditHeader.vue"),
    meta: {
      title: "修改头像",
    },
  },
  {
    path: "/newContent/:usid",
    name: "NEWCONTENT",
    component: () =>
      import(/* webpackChunkName: "my" */ "@/views/NewContent.vue"),
    meta: {
      title: "新动态",
    },
  },
  {
    path: "/moreComments/:usid/:contentid",
    name: "MORECOMMENTS",
    component: () =>
      import(/* webpackChunkName: "my" */ "@/views/MoreComments.vue"),
    meta: {
      title: "更多评论",
    },
  },
  {
    path: "/position/:position",
    name: "POSITION",
    component: () =>
      import(/* webpackChunkName: "my" */ "@/views/Position.vue"),
    meta: {
      title: "地区",
    },
  },
  {
    path: "/good/:usid/:contentid",
    name: "GOOD",
    component: () => import(/* webpackChunkName: "my" */ "@/views/Good.vue"),
    meta: {
      title: "点赞",
    },
  },
  {
    path: "/content/:usid/:contentid",
    name: "CONTENT",
    component: () =>
      import(/* webpackChunkName: "content" */ "@/views/Content.vue"),
    meta: {
      title: "动态",
    },
  },
  {
    path: "/updateimg/:usid",
    name: "UPDATEIMG",
    component: () =>
      import(/* webpackChunkName: "updateimg" */ "@/views/UpdateImg.vue"),
    meta: {
      title: "添加动态",
    },
  },
  {
    path: "/morefollownewcontent/:usid",
    name: "MOREFOLLOWNEWCONTENT",
    component: () =>
      import(
        /* webpackChunkName:"morefollownewcontent" */ "@/views/MoreFollowNewContent.vue"
      ),
    meta: {
      title: "更多新动态",
    },
  },
  {
    path: "/follower/:usid",
    name: "FOLLOWER",
    component: () =>
      import(/* webpackChunkName: "follower" */ "@/views/Follower.vue"),
    meta: {
      title: "粉丝",
    },
  },
  {
    path: "/follows/:usid",
    name: "FOLLOWS",
    component: () =>
      import(/* webpackChunkName: "follows" */ "@/views/Follows.vue"),
    meta: {
      title: "已关注",
    },
  },
  {
    path: "/login/:bounce",
    name: "LOGIN",
    component: () =>
      import(/* webpackChunkName: "login" */ "@/views/Login.vue"),
    meta: {
      title: "登录",
    },
  },
  {
    path: "/register/:bounce",
    name: "REGISTER",
    component: () =>
      import(/* webpackChunkName: "register" */ "@/views/Register.vue"),
    meta: {
      title: "注册",
    },
  },
  {
    path: "/forgotpassword/:bounce",
    name: "FORGOTPASSWORD",
    component: () =>
      import(
        /* webpackChunkName: "forgotPassword" */ "@/views/ForgotPassword.vue"
      ),
    meta: {
      title: "找回密码",
    },
  },
  {
    path: "/seting/:usid",
    name: "SETING",
    component: () =>
      import(/* webpackChunkName: "forgotPassword" */ "@/views/Seting.vue"),
    meta: {
      title: "设置",
    },
  },
  {
    path: "/sns/:usid",
    name: "SNS",
    component: () =>
      import(/* webpackChunkName: "forgotPassword" */ "@/views/Sns/Sns.vue"),
    meta: {
      title: "留言",
    },
  },
  {
    path: "/snsmessage/:usid",
    name: "SNSMESSAGE",
    component: () =>
      import(
        /* webpackChunkName: "forgotPassword" */ "@/views/Sns/SnsMessage.vue"
      ),
    meta: {
      title: "发消息",
    },
  },
  {
    path: "/allrecommendusers/:usid",
    name: "ALLRECOMMENDUSERS",
    component: () =>
      import(
        /* webpackChunkName:"allRecommendUsers" */ "@/views/AllRecommendUsers"
      ),
    meta: {
      title: "全部推荐",
    },
  },
  {
    path: "/morecommenduser/:usid",
    name: "MORERECOMMENDUSER",
    component: () =>
      import(
        /* webpackChunkName:"moreRecommentUser" */ "@/views/MoreRecommendUser"
      ),
    meta: {
      title: "更多推荐",
    },
  },
  {
    path: "/tags/:v",
    name: "TAGS",
    component: () => import(/* webpackChunkName:"tags" */ "@/views/Tags"),
    meta: {
      title: "标签相关",
    },
  },
];

const router = new VueRouter({
  //mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
